const mongoose = require("mongoose");
const Schema = mongoose.Schema;

const UserProblemSchema = mongoose.Schema({
  // 发布者
  user: {
    type: Schema.Types.ObjectId,
    ref: "User",
    require: true,
  },
  // 发布时间
  time: {
    type: Date,
    require: true,
  },
  // 问题清单
  problem: {
    type: Array,
    default: [],
  },
  // 图片文件
  image: {
    type: Array,
    required: true,
  },
  // 视频文件
  video: {
    type: Array,
    required: true,
  },
  // 录音文件
  soundfile: {
    type: Array,
    required: true,
  },
});

const UserProblem = mongoose.model("UserProblem", UserProblemSchema);
module.exports = UserProblem;
